home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / 881 / src6.zoo / a.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-09-24  |  303 b   |  17 lines

  1. #include <math.h>
  2. #include <stdio.h>
  3.  
  4.  unsigned long dd[2];
  5. #define D (*((double*)&dd[0]))
  6. main()    {
  7.     double a=2.4, b=2.5, c=2.6, d, e;
  8.     d=modf(a,&e);
  9.     printf(" %f %f\n",d,e);
  10.     d=modf(b,&e);
  11.     printf(" %f %f\n",d,e);
  12.     d=modf(c,&e);
  13.     printf(" %f %f\n",d,e);
  14.     D = 0.0;
  15.     printf(" %lx %lx\n", dd[0],dd[1]);
  16. }
  17.